<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

<html>
	<head>
		<title>IdeaPad - Edit Settings</title>
		<link rel="stylesheet" type="text/css" href="../styles/main.css">
		<link rel="stylesheet" type="text/css" href="../styles/buttons.css">
		<link rel="stylesheet" type="text/css" href="../styles/currentbutton.css">
	</head>
	<body>
	<div class="header">
			<html:link action="/default"><img src="/IdeaPad/images/ideapad_logo.png" alt="logo" border="0"/></html:link>
			<%
		if(session.getAttribute("username") == null || session.getAttribute("username") == ""){
			%>
			<html:link page="/form/login.jsp" styleClass="menubuttons">Login</html:link>
			<html:link page="/form/registerUser.jsp" styleClass="menubuttons">Register</html:link>
			<%
		}
		else{
			%>
			Hello 
			<%=
			session.getAttribute("username").toString() %>
			<html:link action="viewGroups" styleClass="menubuttons">Groups</html:link>
			<html:link action="manageGroups" styleClass="menubuttons">Manage Groups</html:link>
			<html:link page="/form/editUserSettings.jsp" styleClass="currentbutton">Settings</html:link>
			<html:link action="logout" styleClass="menubuttons">Logout</html:link>
			<%
		}
		 %>
		</div>
		<html:form action="/editUserSettings">
				<h1>Edit your profile</h1>
			<table width="332" cellspacing="3" cellpadding="3" border="1"
				height="300">
				<tbody>
					<tr><td>User ID</td>
					<td><%=request.getSession().getAttribute("userID") %></td>
					</tr>
					<tr>
						<td>
							First Name&nbsp;
						</td>
						<td valign="middle" align="center">
							<input type="text" maxlength="30" name="firstName">
						</td>
					</tr>
					<tr>
						<td>
							Last Name
							<br>
						</td>
						<td align="center" valign="middle">
							<input type="text" maxlength="30" name="lastName">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td valign="top">
							Old Password
							<br>
						</td>
						<td valign="middle" align="center">
							<input type="text" maxlength="20" name="oldPassword">
						</td>
					</tr>
					<tr>
						<td>
							New Password
							<br>
						</td>
						<td align="center" valign="middle">
							<input type="text" maxlength="20" name="newPassword1">
						</td>
					</tr>
					<tr>
						<td valign="top">
							New Password
							<br>
						</td>
						<td valign="middle" align="center">
							<input type="text" maxlength="20" name="newPassword2">
						</td>
					</tr>
					<tr>
						<td valign="top">
							Email
							<br>
						</td>
						<td valign="middle" align="center">
							<input type="text" maxlength="320" name="email">
						</td>
					</tr>
					<tr>
						<td valign="top">
							Phone
							<br>
						</td>
						<td valign="middle" align="center">
							<input type="text" maxlength="10" name="phone">
						</td>
					</tr>
					<tr>
						<td valign="top">
							Gender
							<br>
						</td>
						<td valign="middle" align="center">
							<select name="gender">
								<option value="MALE">
									Male
								</option>
								<option value="FEMALE">
									Female
								</option>
								<option value="NOTSPECIFIED">
									Not Specified
								</option>
							</select>

						</td>
					</tr>
					<tr>
						<td valign="top">
							Location
							<br>
						</td>
						<td valign="middle" align="center">
							<input type="text" maxlength="50" name="location" >
						</td>
					</tr>
				</tbody>
			</table>
			<html:submit />
		</html:form>
	</body>
</html>

